package com.rainman.simpleredis.demo.controller;

import com.rainman.simpleredis.core.SimpleRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;


/**
 * 测试cache增强
 *
 */
@RestController
public class DemoCacheController {

    @Autowired
    SimpleRedis simpleRedis;

    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @Cacheable(cacheNames = "DemoController:gbi#3222"
    )
    @RequestMapping("/gbi")
    public String gbi(Long id)   {

        System.out.println("进入执行方法");

        return "这是当时时间 "+new Date();
    }

}
